// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ICloudQueue.cs" company="AzureContrib (Open source library http://azurecontrib.codeplex.com)">
//   Microsoft Public License (Ms-PL)
// </copyright>
// <summary>
//   Exception for errors when handling Windows Azure Cloud Drives.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Diagnostics.CodeAnalysis;

using Microsoft.WindowsAzure.StorageClient;

namespace AzureContrib.WindowsAzure.StorageClient
{
	/// <summary>
	/// An abstraction over a CloudQueue.
	/// </summary>
	[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "This interface is a generic queue. The naming is correct.")]
	public interface ICloudQueue
	{
		/// <summary>
		/// Adds a message to a queue.
		/// </summary>
		/// <param name="message">The message to add.</param>
		void AddMessage(CloudQueueMessage message);

		/// <summary>
		/// Gets a message from a queue. 
		/// </summary>
		/// <param name="visibilityTimeout">
		/// The visibility Timeout.
		/// </param>
		/// <returns>
		/// The get message.
		/// </returns>
		CloudQueueMessage GetMessage(TimeSpan visibilityTimeout);

		/// <summary>
		/// Delete a message from a queue.
		/// </summary>
		/// <param name="message">
		/// The message.
		/// </param>
		void DeleteMessage(CloudQueueMessage message);

		/// <summary>
		/// Peek into the queue to find if there is a message.
		/// </summary>
		/// <returns>
		/// The message peeked.
		/// </returns>
		CloudQueueMessage PeekMessage();

		/// <summary>
		/// Create the queue if it does not exist.
		/// </summary>
		/// <returns>
		/// The create if not exist.
		/// </returns>
		bool CreateIfNotExist();

		/// <summary>
		/// Does the queue exist?
		/// </summary>
		/// <returns>True if the queue exits</returns>
		bool Exists();

		/// <summary>
		/// Delete the queue.
		/// </summary>
		void Delete();
	}
}